#ifndef __DEVICE_H
#define __DEVICE_H

#include "sys.h"
#include "FreeRTOS.h" 
#include "task.h"

#include "function.h"
#include "logger.h"

struct command {
	void (*func)(void);
};
 
#define __used	__attribute__((__used__))
#define MODULE_INIT(fn)					\
	static struct command __cmd_##fn	__used	\
	__attribute__((__section__(".command.sct"))) = { fn }

extern int dev_init(void);
extern int dev_register(char *dev_name, void *dev);
extern void *dev_get(char *dev_name);

#endif
